package com.shell.governor.access.controller;

import com.shell.bee.base.annotation.Logging;
import com.shell.bee.entity.mvc.RetMsg;
import com.shell.bee.mvc.controller.BaseController;
import com.shell.bee.persistence.model.PageLimit;
import com.shell.governor.access.po.PubAccess;
import com.shell.governor.access.service.PubAccessService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubAccessController extends BaseController {
	@Autowired
	private PubAccessService pubAccessService;

	@RequestMapping
	@Logging(module = "��������", methods = "����������������")
	public List<PubAccess> getPubAccessByPage(PageLimit limit) {
		return this.pubAccessService.selectPubAccessByPage(limit);
	}

	@RequestMapping
	@Logging(module = "��������", methods = "������������")
	public RetMsg setAccessType(PubAccess pubAccess) {
		int s = this.pubAccessService.updateNotNull(pubAccess);
		if (s > 0) {
			return initRetMsg("success", "����������");
		}
		return initRetMsg("warning", "����������");
	}
}